package bigmath;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;

public class LocalDataDemo {
    public static void main(String[] args) {
        LocalDate d1 = LocalDate.now();
        System.out.println(d1);
        LocalDate d2 = LocalDate.of(2022,5,1);
        System.out.println(d2);

        //判断日期是否是一个闰年
        System.out.println(d1.isLeapYear());
        //判断指定日期的早晚
        System.out.println(d1.isBefore(d2));
        System.out.println(d1.isAfter(d2));

        //三周之后
        System.out.println(d1.plus(3, ChronoUnit.WEEKS));

        //星期几
        System.out.println(d1.getDayOfWeek());
        System.out.println(d1.getDayOfMonth());
    }
}
